package com.dy.placeOrder2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dy.placeOrder2.mapper.GoodsMapper;
import com.dy.pojo.Goods;
import com.dy.placeOrder2.service.GoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-19
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public Page<Goods> findAll(Integer current, Integer pageSize, Goods goods) {
        Page<Goods> page = new Page<>(current, pageSize);
        LambdaQueryWrapper<Goods> wrapper = new LambdaQueryWrapper<>();

        return baseMapper.selectPage(page, wrapper);
    }



    @Override
    public Goods findById(Integer id) {
        return goodsMapper.findById(id);
    }

    @Override
    public Goods find(Integer id) {
        return goodsMapper.find(id);
    }
}
